/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import java.math.BigInteger;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlAnyAttribute;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Carito
 */
@Embeddable
@XmlRootElement
public class MacPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 240)
    @Column(name = "NO_MAC")
    private String noMac;
    @Basic(optional = false)
    @NotNull
    @Column(name = "IDUSUARIO")
    private BigInteger idusuario;
    @Basic(optional = false)
    @NotNull
    @Column(name = "IDEMPRESA")
    private BigInteger idempresa;

    public MacPK() {
    }

    public MacPK(String noMac, BigInteger idusuario, BigInteger idempresa) {
        this.noMac = noMac;
        this.idusuario = idusuario;
        this.idempresa = idempresa;
    }

    @XmlAttribute
    public String getNoMac() {
        return noMac;
    }

    public void setNoMac(String noMac) {
        this.noMac = noMac;
    }

     @XmlAttribute
    public BigInteger getIdusuario() {
        return idusuario;
    }

    public void setIdusuario(BigInteger idusuario) {
        this.idusuario = idusuario;
    }

     @XmlAttribute
    public BigInteger getIdempresa() {
        return idempresa;
    }

    public void setIdempresa(BigInteger idempresa) {
        this.idempresa = idempresa;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (noMac != null ? noMac.hashCode() : 0);
        hash += (idusuario != null ? idusuario.hashCode() : 0);
        hash += (idempresa != null ? idempresa.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MacPK)) {
            return false;
        }
        MacPK other = (MacPK) object;
        if ((this.noMac == null && other.noMac != null) || (this.noMac != null && !this.noMac.equals(other.noMac))) {
            return false;
        }
        if ((this.idusuario == null && other.idusuario != null) || (this.idusuario != null && !this.idusuario.equals(other.idusuario))) {
            return false;
        }
        if ((this.idempresa == null && other.idempresa != null) || (this.idempresa != null && !this.idempresa.equals(other.idempresa))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.MacPK[ noMac=" + noMac + ", idusuario=" + idusuario + ", idempresa=" + idempresa + " ]";
    }
    
}
